package com.wsx.sky.http.service.impl;

import com.wsx.sky.http.dao.HttpServerMapper;
import com.wsx.sky.http.model.HttpServer;
import com.wsx.sky.http.service.HttpServerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author wangshuaixin
 * @Title: com.wsx.sky.http.service.impl.HttpServerServiceImpl
 * @Description: TODO
 * @date 2018/12/10
 */
@Service
public class HttpServerServiceImpl implements HttpServerService {

    @Autowired
    private HttpServerMapper httpServerMapper;

    @Override
    public int save(String name) {
        return httpServerMapper.save(name);
    }

    @Override
    public String get(String name) {
        HttpServer httpServer = httpServerMapper.get(name);
        if (null != httpServer) {
            return httpServer.getName();
        }
        return null;
    }
}
